import { createSlice } from "@reduxjs/toolkit";


export const WORKER = 2;
export const BOSS = 1;

export const userRoleSlice = createSlice({
  name: "userRole",
  initialState: {
    userRole: WORKER
  },
  reducers: {
    worker: state => {
      state.userRole = WORKER;
    },
    boss: state => {
      state.userRole = BOSS;
    }
  }
});

export const { worker, boss } = userRoleSlice.actions;
export default userRoleSlice.reducer;
